package com.situ.ssm.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.situ.ssm.pojo.bo.StudentSearchBO;
import com.situ.ssm.pojo.entity.Student;
import com.situ.ssm.service.IStudentService;
import com.situ.ssm.util.JSONResult;

@Controller
@RequestMapping("/student")
public class StudentController {
	@Autowired
	private IStudentService studentService;

	@ResponseBody
	@RequestMapping("/selectAll")
	public List<Student> selectAll() {
		List<Student> list = studentService.selectAll();
		return list;
	}
	
	@ResponseBody
	@RequestMapping("/selectByPage")
	public JSONResult selectByPage(StudentSearchBO studentSearchBO, Integer page, Integer limit) {
		JSONResult jsonResult = studentService.selectByPage(studentSearchBO, page, limit);
		return jsonResult;
	}
}
